import PageList from '../../../../wxjs/PageList.js'
const app = getApp();
const reqUrl = app.serAddrs.getAllPrivateLetterList;

var data = {
  xhx_images: app.xhx_images,
  xhx_route: app.xhx_route,
};

var currentPage = {
  data,
  reqUrl,
  onShow,
  getLatestMessage,
};

var page = Object.assign({},PageList, currentPage);

Page(page)

function onShow() {
  const that = this;
  // 初始化上拉加载方法
  that.listDataInit();
  that.getLatestMessage();
}

function getLatestMessage(){
  const that = this;

  app.middleware.requestAjax({
    serAddr: app.serAddrs.getLatestMessage,
    cancelToast: true,
    success: function (res) {
      that.setData({
        messList:res.data || []
      })
    },
    fail: function (res) {
      
    }
  })
}